Conversation
Normalize filler triples before reconstructing the source matching. Include the reverse-construction proof and noncanonical-witness regressions.
…orage Keep witness and value mappings on executed reduction results, separate finite brute-force enumeration from model semantics, and make numeric failures explicit. Use native HiGHS execution and sprs-backed QUBO matrices; update registered construction, callers, documentation, and regression tests together.
Reuse the ILP row buffer and combine repeated Steiner extraction scans. Use petgraph union-find, connectivity, and articulation-point implementations in the existing graph checks.
Apply model construction checks to persisted input and reconstruct derived caches from source fields. Preserve public constructor and setter signatures, return deserialization errors for invalid input, and cover creation and loading boundaries with regression tests.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1151 +/- ##
==========================================
+ Coverage 95.93% 96.49% +0.56%
==========================================
Files 1074 1069 -5
Lines 132106 145001 +12895
==========================================
+ Hits 126730 139914 +13184
+ Misses 5376 5087 -289 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Reject constraint-violating candidates and feedback-arc incumbents that do not satisfy the recovery premise. Carry complete ILP results through dispatch and evaluate external target results once at the recovery boundary. Validation: 6,523 workspace tests passed; clippy and formatting passed; changed-line coverage 96.98%.
Use the model constructors for flow create specifications and deserialization. Reject negative internal multipliers and bundle requirements consistently, and test malformed terminals, capacities, bundles, and homologous arc indices through both input paths. Validation: 6,526 workspace tests passed; clippy and formatting passed. Local PR changed-line coverage against origin/main is 97.54%; changed lines in the three flow models have 100% coverage.
Normalize forced vertex-cover choices, long NAE clauses, and repeated set elements. Preserve empty matching instances and target construction errors. Keep Ullman filler layers nonempty and recover satisfiability from the makespan threshold. Add regression tests and matching proof updates.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…rtex cover Retarget KSatisfiability/K3 to the unit-weight decision cover it constructs, add the explicit One -> i64 decision cast that keeps ComparativeContainment reachable, and let #[reduction] name macro-forwarded Decision inner types. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ruction path The create spec now delegates to try_new so the sign check lives in one place. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Persisted triangle and edge lists were trusted verbatim, so malformed JSON panicked in evaluate and graph-only construction input was rejected. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
PathConstrainedNetworkFlow, MixedChinesePostman, ConsecutiveOnesMatrixAugmentation, and MaximumContactMapOverlap now load through their fallible constructors; MaximumContactMapOverlap gains try_new. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Import SolveOutcome inside the example-db builders that are its only users, gate the example-only cover check, and drop the unread normalized_n field. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Problem::Value requires EvaluationValue, which only Max, Min, Or, and Extremum implement, so Sum and And could no longer be model values. Delete the types, the Sum-only AggregationError::ArithmeticOverflow variant, their tests, and the docs and skills that advertised aggregate-only models. Rename the test fixtures that still described the removed aggregate reduction path. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Cover InsufficientSolutionQuality in each rule's own test file, the zero-penalty Feasible mapping of the penalty rules, and infeasible sources recovered through recover_result. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ht variant Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…vertex cover cast Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
QUBO JSON is now {num_vars, entries: [[row, column, value], ...]} in
row-major order instead of the sprs CSR serde layout. Loading feeds
entries through the from_sparse validation path and the legacy
{num_vars, matrix} shape through from_matrix, with typed errors for
missing or conflicting fields, out-of-range indices, duplicates, ragged
rows, and a num_vars mismatch.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This reverts commit 675711d.
Problem::Value returns to the base `Clone` bound so Sum- and And-valued problems evaluate and fold through the Aggregate contract again. EvaluationValue is now required by ReductionResult endpoints, by SolutionAggregate and OptimizationValue as a supertrait, by SolveOutcome constructors, and by registration through impl_dyn_problem!. Passing a fold-only problem to a solve or recovery API is a compile error. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
State where EvaluationValue is required, and stop advertising aggregate-only models in the skills: registration, solving, and reduction endpoints accept only Max, Min, Or, and Extremum values. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…s in pred extract
Type-erased recovery relocates a rule's InsufficientSolutionQuality to
InsufficientSolutionQualityAt { source_problem, target_problem }, so chain and
CLI errors name the hop that rejected the incumbent while direct typed
recover_result calls keep returning the unit variant. is_insufficient_quality()
matches both for callers behind a chain.
pred extract prints a one-line stderr note when a source infeasible result
rests on the external file's optimal or infeasible claim; stdout is unchanged.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Add recover_by_source_evaluation for rules where a feasible source forces every tied target optimum to decode to a valid source solution, and route the nine rules that hand-wrote that body through it. Route the hand-written status-preserving matches through recover_preserving_status. Behaviour is unchanged; no rule test was modified. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The root-only command never linted the CLI and macros crates or the mcp and benchmarks features. Every feature is pure Rust, so the Clippy job needs no extra system packages. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Review of #1151The recovery design is sound. Two reviewers read every hand-written The PR also had one regression that broke the NP-hardness chains, a few confirmed bugs, and several breaking changes the description does not mention. I fixed what I could and pushed the commits listed below ( Fixed in the pushed commitsThe 3-SAT chain to HamiltonianCircuit was cut.
Bugs.
QUBO JSON.
Tests for the branches this PR is about. Duplication. CI. Please handle
Questions
Smaller notes
At 1041 files this PR cannot be bisected. It mixes an API migration, dependency major bumps, a storage change, serde validation, model removals and a bug fix. The dependency commit and the 3-partition fix could have landed on their own. |
Review boundaryMain-based changes without the core API migration are available in:
The local combined tree passes 6,572 workspace all-feature tests (2 ignored), all-target/all-feature Clippy, and 3 website build-contract tests. Combined changed-line Rust coverage is 99.64%. The core review retains reduction/result recovery and solver interfaces, aggregate/counting semantics, public generic-bound changes, CVP/QUBO representations and numeric boundaries, graph path capabilities, and mathematical construction changes requiring separate justification. In particular, the remaining generic deserialization changes narrow public trait implementations, and MaximumLikelihoodRanking needs a consistent comparison-count range contract. No PR has been merged to main. This PR still contains the extracted changes until the main-based PRs are merged and its base can be updated; no force-push or API migration was performed during extraction. |
|
Closing this omnibus PR in favor of the independently reviewable main-based PRs and a separate [Critical] PR for the remaining API changes. The source branch is retained; this closure does not merge or discard its commits. |
This PR makes an executed reduction responsible for constructing its target and recovering the complete source result. Solvers and CLI workflows use that same recovery path, including when a target optimum establishes source infeasibility.
API and behavior
ReductionResult::recover_result(source, target_result)returns the complete source result.Rc; shared path prefixes reuse that execution.SolveOutcomedistinguishesOptimal,Feasible, andInfeasible; execution failures remain errors.Decision<P>where appropriate; rule-owned recovery handles bounds and penalty semantics.pred extract bundle.json --result target-result.jsonaccepts a complete result, validates the target witness, and follows the same recovery path as bundle solving.For example, a penalty QUBO can have an optimum even when its source ILP is infeasible. The ILP-to-QUBO rule interprets its established energy relation and returns source
Infeasible. A merely feasible candidate that cannot establish the source result returnsInsufficientSolutionQuality, never a proof of infeasibility.The solver establishes optimality;
SolveOutcome::optimalpackages that result and evaluates the witness. Each rule implements its recovery semantics explicitly. There is no default recovery strategy or new cross-rule recovery abstraction.Supporting changes
sprs, reuse ILP buffers, and use existing petgraph algorithms for applicable graph operations.ProblemMetadatatrait and point documentation to catalog lookup; narrow internal helper visibility.This is a package-wide API migration. The broad file count includes model/rule callers and their tests. Verifier tooling, local skills, and generated reports are excluded.
Validation
make checkcargo clippy --workspace --all-targets --all-features -- -D warningsorigin/main(before the final metadata cleanup)Refs #1148.